
var ParseTemplate = ZFT.Util.ParseTemplate;
var STip = ZFT.Util.STip;

var Template = {
    detail: ParseTemplate(require("./tpl/detail.xtpl"))
}
var UserDetail = ZFT.Util.Class({
    container: $("#infoBox"),
    init: function () {
        var _this=this;
        _this.loadUserInfo();
    },
    loadUserInfo: function () {
        var _this = this;
        var container = _this.container;
        ZFT.Util.Ajax("/r/UserCenter_getUserInfo", {
            type: "POST",
            dataType: "json",
            loading: function () {
                var loading = '<span class="z-t-a-c i-b p100">加载中，请稍候...</span>';
                container.html(loading);
            },
            success: function (res) {
                if (res.code == 200) {
                    var html=Template.detail({data:res.data});
                    container.html(html);
                } else {
                    var error = '<span class="z-t-a-c i-b p100">' + res.msg + '</span>';
                    container.html(error);
                }
            }
        })
    }
})

$(function(){
    new UserDetail();
})